#ifndef ZIBGUSCONNECTION_H
#define ZIBGUSCONNECTION_H

#include <QObject>
#include <AbstractZigbusConnection.h>

#include "ZigbusMessage.h"

class QextSerialPort;

class UsbZigbusConnection : public AbstractZigbusConnection
{
    Q_OBJECT
private:
    QString tty;
    QextSerialPort *serialPort;

public:
    explicit UsbZigbusConnection(const QString& ttyName, QObject* parent = 0);
    virtual ~UsbZigbusConnection();

    const QString& getPortName() const { return tty; }
    void setPortName(const QString& portName) { tty = portName; }

    virtual bool isOpen() const;

public slots:
    void readAvailableData();
    virtual void sendMessage(ZigbusMessage message);
    virtual bool open();
    virtual void close();
};

#endif // ZIBGUSCONNECTION_H
